package mode23.clone;

import lombok.*;

/**
 * 汽车原型
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
public class CarPrototype implements Cloneable{

    private String name;
    private String color;

    //重写clone方法
    @Override
    protected CarPrototype clone() {
        CarPrototype car = null;
        try {
            car = (CarPrototype) super.clone();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return car;
    }
}
